<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <link rel="stylesheet" href="tpl/css/lib/swiper.min.css">
    <link rel="stylesheet" href="tpl/css/app.css">
    <title>Document</title>
</head>
<body style="background: #dcdddd;">
    <div id="container">
        
    </div>

    <script id="tpl" type="text/html">
        <div class="focus">
            <div class="swiper-container">
                <div class="swiper-wrapper">
                    <div class="swiper-slide"><img src="tpl/img/tmp/1.jpg"></div>
                    <div class="swiper-slide"><img src="tpl/img/tmp/1.jpg"></div>
                    <div class="swiper-slide"><img src="tpl/img/tmp/1.jpg"></div>
                </div>
                <!-- Add Pagination -->
                <div class="swiper-pagination"></div>
            </div>
        </div>
        <section class="index-section">
            <span class="index-title">菜品一</span>
            <span class="index-title2">咖喱海鲜饭</span>
            <div class="index-intro">
                白生生的鸡肉块，<br>
                又裹了一层果仁儿白芝麻，<br>
                随时相声都让人口水长流。
            </div>
            <div class="index-img">
                <img src="tpl/img/dang.png" alt="" class="index-icon">
                <img src="tpl/img/tmp/2.jpg" alt="">
            </div>
            <div class="index-detail">
                <img src="tpl/img/bian.png" alt="" class="index-icon">
                <div class="index-detail-text">
                    <span class="index-detail-title">主菜</span>
                    <span class="index-detail-info">去骨鸡腿200g/花生15g</span>
                </div>

                <div class="index-detail-text">
                    <span class="index-detail-title">配菜</span>
                    <span class="index-detail-info">海苔蛋卷30g/培根小番茄25g/耗油香菇25g/荷兰豆20g</span>
                </div>

                <div class="index-detail-text">
                    <span class="index-detail-title">主食</span>
                    <span class="index-detail-info">米饭2A00g</span>
                </div>

                <div class="index-detail-text">
                    <span class="index-detail-title">营养</span>
                    <span class="index-detail-info">35ｇ.蛋白质/ 310.卡路里 / 4g.糖份</span>
                </div>
            </div>
        </section>
        <section class="index-section">
            <span class="index-title">菜品一</span>
            <span class="index-title2">咖喱海鲜饭</span>
            <div class="index-intro">
                白生生的鸡肉块，<br>
                又裹了一层果仁儿白芝麻，<br>
                随时相声都让人口水长流。
            </div>
            <div class="index-img">
                <img src="tpl/img/dang.png" alt="" class="index-icon">
                <img src="tpl/img/tmp/2.jpg" alt="">
            </div>
            <div class="index-detail">
                <img src="tpl/img/bian.png" alt="" class="index-icon">
                <div class="index-detail-text">
                    <span class="index-detail-title">主菜</span>
                    <span class="index-detail-info">去骨鸡腿200g/花生15g</span>
                </div>

                <div class="index-detail-text">
                    <span class="index-detail-title">配菜</span>
                    <span class="index-detail-info">海苔蛋卷30g/培根小番茄25g/耗油香菇25g/荷兰豆20g</span>
                </div>

                <div class="index-detail-text">
                    <span class="index-detail-title">主食</span>
                    <span class="index-detail-info">米饭2A00g</span>
                </div>

                <div class="index-detail-text">
                    <span class="index-detail-title">营养</span>
                    <span class="index-detail-info">35ｇ.蛋白质/ 310.卡路里 / 4g.糖份</span>
                </div>
            </div>
        </section>
    </script>

    <script src="tpl/js/lib/jquery.min.js"></script>
    <script src="tpl/js/lib/swiper.min.js"></script>
    <script src="tpl/js/lib/laytpl.js"></script>
    <script src="tpl/js/app.js"></script>
    <script>
        $(document).ready(function($) {
            renderTpl({})

            var swiper = new Swiper('.swiper-container', {
                    pagination: '.swiper-pagination',
                    paginationClickable: true,
                    loop: true
                });

            $(".index-detail-title").each(function(index, el) {
                var textArray = $(el).text().split("");
                var htmlStr = "";
                for (var i in textArray) {
                    htmlStr += "<span>"+textArray[i]+"</span>"
                }
                $(el).html(htmlStr)
            });
        });
    </script>
</body>
</html>